import Vue from 'vue'
import VueRouter from 'vue-router'
import Wen from '../components/Wen.vue'
import Da from '../components/Da.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue'),
    meta:{
      hideNavigationBar:true,
      hideBottom:true
    }
  },
  {
    path: '/register',
    name: 'register',
    component: () => import('../views/Register.vue'),
    meta:{
      hideNavigationBar:true,
      hideBottom:true
    },
  },
  {
    path: '/tongyong1',
    name: 'tongyong1',
    component: () => import('../views/TongYong1.vue'),
  },
  {
    path: '/tongyongzuofa1',
    name: 'tongyongzuofa1',
    component: () => import('../views/TongYongZuoFa1.vue'),
  },
  {
    path: '/tongyongzuofa',
    name: 'tongyongzuofa',
    component: () => import('../views/TongYongZuoFa.vue'),
  },
  {
    path: '/tongyong',
    name: 'tongyong',
    component: () => import('../views/TongYong.vue'),
  },
  {
    path: '/shipufenlei',
    name: 'shipufenlei',
    component: () => import('../views/ShiPuFenLei.vue'),
  },
  {
    path: '/healthydiet',
    name: 'healthydiet',
    component: () => import('../views/HealthyDiet'),
  },
  {
    path: '/dadetail',
    name: 'dadetail',
    component: () => import('../views/DaDetail.vue'),
  },
  {
    path: '/wenda',
    name: 'wenda',
    redirect: '/Da',
    component: () => import('../views/wenDa.vue'),
    children: [{
        path: '/Wen',
        name: 'Wen',
        component: Wen
      },
      {
        path: '/Da',
        name: 'Da',
        component: Da
      }
    ]
  },
  {
    path: '/zuofaxiangqing',
    name: 'zuofaxiangqing',
    props: true,
    component: () => import('../views/ZuofaXiangqing.vue'),
  },
  {
    path: '/caipuzuofa',
    name: 'caipuzuofa',
    props: true,
    component: () => import('../views/caiPuZuofa.vue'),
    meta: {
      keepAlive: true,
    }
  },
  {
    path: '/caipu',
    name: 'caipu',
    component: () => import('../views/caiPu.vue'),
  },
  {
    path: '*',
    name: 'aboutview',
    component: () => import('../views/AboutView.vue'),
  },
  {
    path: '/',
    redirect: 'myindex',
  },
  {
    path: '/byzr',
    name: 'byzr',
    component: () => import('../views/Byzr.vue'),
  },
  {
    path: '/bzzr',
    name: 'bzzr',
    component: () => import('../views/Bzzr.vue'),
  },
  {
    path: '/lbt',
    name: 'lbt',
    component: () => import('../views/Lbt.vue'),
  },
  {
    path: '/zozi',
    props:true,//开启props接收参数功能
    name: 'zozi',
    component: () => import('../views/Zozi.vue'),
  },
  {
    path: '/slideshow-1',
    name: 'slideshow-1',
    component: () => import('../views/Slideshow-1.vue'),
  },
  {
    path: '/bottom',
    name: 'bottom',
    component: () => import('../components/Bottom.vue'),
  },
  {
    path: '/myindex',
    name: 'myindex',
    component: () => import('../views/MyIndex.vue'),
  },
  {
    path: '/navigationbar',
    name: 'navigationbar',
    component: () => import('../components/NavigationBar.vue'),
  },
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
